{include file="public/header" /}
{load href="__PLUGINS__bootstrap/bootstrap-table.min.css"}
{load href="__PLUGINS__bootstrap/bootstrap-table.min.js"}
<!-- {load href="__PLUGINS__layui/layui.js"}
{load href="__PLUGINS__layui/css/layui.css"} -->
<style type="text/css">
    #des,#des input{ width: 40px;text-align:center;}
    #id{ width: 78px; }
    .bs-checkbox{ width: 36px; height: 40px }
    .fixed-table-toolbar .columns,.fixed-table-toolbar .search{margin-left:0px; margin-top: 0px }
    #title span{ float: right; }
    .asdlkjasd{ background: #1ab394; color: #fff}
    .ibox-content {
        clear: both;
        overflow-x: auto;
    }
</style>
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="ibox float-e-margins">
        <div class="">
            <a onclick="add('{:url(\'adddown\',[\'url\'=>-1])}')" href="javascript:void(0);" class="btn btn-primary ">上传安装包</a>
        </div>
        <script type="text/javascript">
            function add(url){
                layer.open({
                    type: 2,
                    title: '提示',
                    shadeClose: false,
                    shade: 0.2,
                    area: ['90%', '90%'],
                    skin:'shangchuantup',
                    shift:-1,
                    content: url,
                    scrollbar: false,
                    moveType: 1,
                    moveOut: true
                });
            }
        </script>
        <div class="ibox-content">
            {include file="public/topsection"}
            <div class="row row-lg">
                <div class="col-sm-12">
                    <div class="example">
                        <form class="form-horizontal" method="post">
                            <table data-toggle="table">
                                <thead>
                                <tr>
                                    <th data-align="center">ID</th>
                                    <th data-align="center">链接</th>
                                    <th data-align="center">二维码</th>
                                    <th data-align="center">版本</th>
                                    <th data-align="center">时间</th>
                                </tr>
                                </thead>
                                <tbody id="form">
                                {volist name="data" id="v"}
                                <tr id="id{$v.id}" class="class">
                                    <td>{$v.id}</td>
                                    <td><a href="__ROOT__{$v.url}" target="_blank">{:changeUrl($v.url)}</a></td>
                                    <td>
                                        <a href="__ROOT__{$v.url}" target="_blank">
                                            <img style="max-width:200px" src="{$v.image}"/>
                                        </a>
                                    </td>
                                    <td>{$v.version}</td>
                                    <td>{:date('Y-m-d H:i', $v.create_time)}</td>
                                    <td>
                                        <div class="btn-group">
                                            <div data-toggle="dropdown" class="btn btn-primary btn-xs dropdown-toggle">
                                                操作 <span class="caret"></span>
                                            </div>
                                            <ul class="dropdown-menu">
                                                <li><a onClick="del({$v.id})" style="color:red">删除</a>
                                                </li>
                                            </ul>
                                        </div>
                                    </td>
                                </tr>
                                {/volist}
                                </tbody>
                            </table>
                        </form>
                    </div>
                </div>
            </div>
            <hr>
            <div class="row row-lg">
                <div class="col-sm-12 pages">{$page}</div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}






<script type="text/javascript">

    layui.use(['laydate'], function(){
        var laydate = layui.laydate;
        var form = layui.form;

        //执行一个laydate实例
        laydate.render({
            elem: '#date' //指定元素
            ,type: 'date'
            ,trigger: 'click'
        });
    })

    function del(id){
        swal_del(id,"{:url('downdel')}")
    }

    /*弹出层*/
    /*
        参数解释：
        title   标题
        url     请求的url
        id      需要操作的数据id
        w       弹出层宽度（缺省调默认值）
        h       弹出层高度（缺省调默认值）
    */
    function x_admin_show(title,url,w,h)
    {
        if (title == null || title == '') {
            title=false;
        };
        if (url == null || url == '') {
            url="404.html";
        };
        if (w == null || w == '') {
            w=($(window).width()*0.9);
        };
        if (h == null || h == '') {
            h=($(window).height() - 50);
        };
        layer.open({
            type: 2,
            area: [w+'px', h +'px'],
            fix: false, //不固定
            maxmin: true,
            shadeClose: true,
            shade:0.4,
            title: title,
            content: url,
            end: function (){
                window.location.reload();
            }

        });
    }

</script>
 